import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import User from '@/components/User'
import Permission from '../components/Permission'
import ChangePwd from '../components/ChangePwd'

import Login from '../components/Login'
import Main from '../components/Main'

//合同管理
import Contract from '../components/Contract'
//审核模块
import Loan_Approval from '../components/Loan_Approval'
//企业模块
import Business from '../components/Business'

import Collateral from '../components/Collateral'
import PreLoan from '../components/PreLoan'

//授信模块
import Activiti from '../components/Activiti'
import EnterpriseCredit from '../components/EnterpriseCredit'
import Task from '../components/Task'

//用信模块
//核心企业用信页面
import Core_Credit_Used from '../components/Core_Credit_Used'
//上下游企业用信页面
import Guarantee from '../components/Guarantee'


//---start 贷后管理模块 -----
import repayment_manage from '@/components/repayment_manage'
import repayment_protection from '@/components/repayment_protection'
import repayment_reminder from '@/components/repayment_reminder'
//---end 贷后管理模块 -----


Vue.use(Router)

export default new Router({

  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/main',
      name: 'Main',
      component: Main,
      children: [
        {
          // ---start 系统管理模块 -----
          path: '/user',
          name: 'User',
          component: User
        },
        {
          path: '/permission',
          name: 'Permission',
          component: Permission
        },
        {
          path: '/changePwd',
          name: 'ChangePwd',
          component: ChangePwd
        },
        // ---end 系统管理模块 -----
        // ---start 贷后管理模块 -----
        {
          path: '/repayment_manage',
          name: 'repayment_manage',
          component: repayment_manage
        },
        {
          path: '/repayment_protection',
          name: 'repayment_protection',
          component: repayment_protection
        },
        {
          path: '/repayment_reminder',
          name: 'repayment_reminder',
          component: repayment_reminder
        }
        // ---end 贷后管理模块 -----


        //合同模块
        ,{
          path: '/contract',
          name: 'Contract',
          component: Contract
        }
        //审核模块
        ,{
          path: '/loan_approval',
          name: 'Loan_Approval',
          component: Loan_Approval
        },
        //企业模块
        {
          path: '/business',
          name: 'Business',
          component: Business
        },
        //担保物
        {
          path: '/collateral',
          name: 'Collateral',
          component: Collateral
        },
        //担保物
        {
          path: '/preLoan',
          name: 'PreLoan',
          component: PreLoan
        }
        //授信模块
        ,{
          path: '/activiti',
          name: 'Activiti',
          component: Activiti
        }
        ,{
          path: '/enterpriseCredit',
          name: 'EnterpriseCredit',
          component: EnterpriseCredit
        }
        ,{
          path: '/task',
          name: 'Task',
          component: Task
        }
         //用信模块
         //核心企业用信页面
         ,{
          path: '/core_credit_used',
          name: 'Core_Credit_Used',
          component: Core_Credit_Used
        }
         //上下游企业用信页面
         ,{
          path: '/guarantee',
          name: 'Guarantee',
          component: Guarantee
        }

      ]
    },
    {
      path: '/contract',
      name: 'Contract',
      component: Contract
    },
    

    // {
    //   path: '/contract',
    //   name: 'Contract',
    //   component: Contract
    // },
  ]
})
